package edu.whu.demo.dao;

import edu.whu.demo.domain.Supplier;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 王冠儒
 * @since 2023-10-22
 */
@Mapper
public interface SupplierDao extends BaseMapper<Supplier> {

    @Select("select * from supplier where id in (select supplier_id from commodity_supplier where commodity_id = #{commodityId})")
    List<Supplier> getSuppliersByCommodityId(Integer commodityId);


}
